<%@ page contentType="text/html;charset=UTF-8" %>
<script type="text/javascript" src="//cdn.bootcss.com/highcharts/4.1.7/highcharts.js"></script>
<script>
	function getHighcharts($selector, $title, $subtitle, $categories, $yAxisTitle, $series){

	   var title = {
	       text: $title   
	   };
	   var subtitle = {
	        text: $subtitle
	   };
	   var xAxis = {
	       categories: $categories
	   };
	   var yAxis = {
	      title: {
	         text: $yAxisTitle
	      },
	      plotLines: [{
	         value: 0,
	         width: 1,
	         color: '#808080'
	      }]
	   };   
	
	   var tooltip = {
	      valueSuffix: ''
	   }
	
	   var legend = {
	      layout: 'vertical',
	      align: 'right',
	      verticalAlign: 'middle',
	      borderWidth: 0
	   };
	
	   var series =  $series;
	
	   var json = {};
	
	   json.title = title;
	   json.subtitle = subtitle;
	   json.xAxis = xAxis;
	   json.yAxis = yAxis;
	   json.tooltip = tooltip;
	   json.legend = legend;
	   json.series = series;
	
	   $($selector).highcharts(json);
	}
</script>